package 
{
	import org.flixel.FlxG;
	import org.flixel.FlxSprite;

    public class AlienBasic extends FlxSprite
    {
		//private var weapon:Weapon;
		
        public function AlienBasic():void
        {
            super(0, 0);
			this.makeGraphic(20, 20, 0xFF0000FF);
			exists = false;
			//this.weapon = weapon;
        }

		public function spawn():void
		{
			x = FlxG.width;
            y = Math.random() * (FlxG.height - 100) + 50;
			velocity.x = -200;
			health = 2;
			exists = true;
		}

		override public function kill():void
		{
			
			super.kill();
			Registry.scoreThisLevel += 10;
			Registry.scoreThisGame += 10;
		}

        override public function update():void
        {
            velocity.y = Math.cos(x / 50) * 50;
            super.update();

			if (x < -50)
			{
				exists = false;
			}
			if (onScreen()) {
				fire();
			}
        }
		
		public function fire():Boolean {
			return true;
		}
    }
}